package com.note.simpleshop.module.goods.controller;

import com.note.simpleshop.constant.ErrorCode;
import com.note.simpleshop.entity.TbClassify;
import com.note.simpleshop.module.goods.service.ClassifyService;
import com.note.simpleshop.vo.Msg;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("goods/classify")
public class ClassifyController {
    @Autowired
    private ClassifyService classifyService;
    @ApiOperation(value = "list", notes = "商品分类列表")
    @PostMapping(value = "list")
    public Msg<TbClassify> index() {
        Msg msg=new Msg();
        msg.setErrorCode(ErrorCode.ERROR_0000);
        List<TbClassify> list=classifyService.findAll();
        msg.setData(list);
        return msg;
    }
}
